////////////////////////////////////////////////////////////////////////
// Generate.php 

<?php
header("Content-type: image/png");

$avatars[] = "dynamic/171.png";
$avatars[] = "dynamic/173.png";
$avatars[] = "dynamic/251.png";


$avatar = $avatars[mt_rand(0, count($avatars)-1)];

$newavatar = imagecreatefrompng($avatar);
imagepng($newavatar);
imagedestroy($newavatar);

?>

///////////////////////////////////////////////////////////////////
// .htaccess

RewriteEngine On

RewriteRule dynamic.png dynamic.php